package main

import (
	"fmt"
)

func main() {
	// var a map[string]string
	// a = make(map[string]string, 15)
	// a["zsh"] = "zsh"
	// a["zsh1"] = "zsh1"
	// a["zsh2"] = "zsh2"
	// a["zsh3"] = "zsh3"

	// fmt.Println(a)

	//map切片
	var monsters []map[string]string
	monsters = make([]map[string]string, 2)
	if monsters[0] == nil {
		monsters[0] = make(map[string]string)
		monsters[0]["name"] = "zsh"
		monsters[0]["age"] = "18"
	}

	if monsters[1] == nil {
		monsters[1] = make(map[string]string)
		monsters[1]["name"] = "zsh2"
		monsters[1]["age"] = "19"
	}

	fmt.Println(monsters)
	newMonster := make(map[string]string)
	newMonster["name"] = "zsh3"
	newMonster["age"] = "11"

	monsters = append(monsters, newMonster)
	fmt.Println(monsters)
}
